/*******************************************************************************
 * @project: Java_Genericit
 * @package: com.burns.java.generic
 * @file: Test3.java
 * @author: Administrator
 * @created: 2017年5月16日
 * @purpose:
 * 
 * @version: 1.0
 * 
 * Revision History at the end of file.
 * 
 * Copyright 2017 AcconSys All rights reserved.
 ******************************************************************************/

package com.burns.java.generic;

public class Test3 {
	public static void main(String[] args) {
		Box<String> name = new Box<String>("corn");
		Box<Integer> age = new Box<Integer>(712);

		System.out.println("name class:" + name.getClass()); // com.qqyumidi.Box
		 System.out.println("name:" + name.getData());
		System.out.println("age class:" + age.getClass()); // com.qqyumidi.Box
		 System.out.println("age:" + age.getData());
		System.out.println(name.getClass() == age.getClass()); // true}

	}
}

class Box<T> {

	private T data;

	public Box() {

	}

	public Box(T data) {
		this.data = data;
	}

	public T getData() {
		return data;
	}

}

/*******************************************************************************
 * <B>Revision History</B><BR>
 * [type 'revision' and press Alt + / to insert revision block]<BR>
 * 
 * 
 * 
 * Copyright 2017 AcconSys All rights reserved.
 ******************************************************************************/